package com.syq.dto;


import com.syq.pojo.CheckNull;
import com.syq.pojo.CheckType;
import lombok.Data;
import lombok.ToString;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

@Data
@ToString
public class SysDeviceDto implements CheckNull {
    private String deviceId;
    private String deviceName;
    private Long categyId;

    @Override
    public boolean isEmpty(CheckType type) {
        switch (type){
            case ADD :
                return !StringUtils.hasText(deviceId)||!StringUtils.hasText(deviceName)||ObjectUtils.isEmpty(categyId);
        }
        return false;
    }
}
